package inventory.daoImplementer;

import java.sql.SQLException;

import dbhandelling.Crude;
import inventory.model.GinItems;

import inventory.daoInterface.GinItemsDao;


public class GinItemsImplementor extends Crude implements GinItemsDao
{
	
	@Override
	public void add(GinItems ginItems) throws Exception 
	{
		insert(ginItems);
	}

	@Override
	public void update(GinItems ginItems) throws Exception 
	{
		
	}

	@Override
	public void delete(GinItems ginItems) throws Exception 
	{
		
	}

	@Override
	public GinItems retreive(String conditionField, String ConditionValue) throws Exception 
	{
		GinItems ginItems=(GinItems) super.retreive("GinItems",conditionField, ConditionValue);
		return ginItems;
	}

	@Override
	public GinItems[] retreiveArray(String conditionField, String conditionValue) throws Exception 
	{
		GinItems[] ginItemss;
		Object[] obj=super.retreiveArrayOnCondition("GinItems", conditionField, conditionValue);
		ginItemss=new GinItems[obj.length];
		
		for(int i=0;i<ginItemss.length;i++)
		{
			ginItemss[i]=(GinItems) obj[i];
		}
		
		return ginItemss;
	}

	@Override
	public GinItems[] retreiveAll() throws Exception 
	{
		GinItems[] ginItemss;
		
		Object[] obj=super.retreiveAll("GinItems");
		
		ginItemss=new GinItems[obj.length];
		
		for(int i=0;i<ginItemss.length;i++)
		{
			ginItemss[i]=(GinItems) obj[i];
		}
		
		return ginItemss;
	}

}
